<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <h1>index.html</h1>
    <div th:each="goods:${goodsList}" th:object="${goods}">
            <a href="javascript:void(0)" th:onclick="|showGoodsInfo(*{id})|">
                <img th:src="*{imageUrl}">
            </a>
        <br>
        <a href="javascript:void(0)" th:onclick="|showGoodsInfo(*{id})|">
            [[*{nameDesc}]]
        </a>
        <br>
        <a href="javascript:void(0)" th:onclick="|showGoodsInfo(*{id})|">
            [[*{name}]]
        </a>
        <a href="javascript:void(0)" th:onclick="|showGoodsInfo(*{id})|">
            [[*{price}]]
        </a>
        <input type="button" value="立即抢购" th:onclick="|showGoodsInfo(*{id})|">
    </div>
    <script>
        function showGoodsInfo(goodsId){
            window.location.href="/showGoodsInfo?goodsId="+goodsId
        }
    </script>
</body>
</html>